import axios from "axios";
import {LoginData, LoginRes} from "@/api/user";
import {configs} from "@typescript-eslint/eslint-plugin";

export interface PopularRecord {
    key: number;
    clickNumber: string;
    title: string;
    increases: number;
}
export interface PolicyRecord {
    id: number;
    version: number;
    version_name: string;
    blueprint: string;
    create_time:string;
    cat_id: number;
    cat_second_id: number;
    cat_name: string;
    cat_second_name: string;
}

export interface PolicyParams extends Partial<PolicyRecord> {
    current: number;
    pageSize: number;
    selected:number;
    isSecond:number;
}
export interface Pagination {
    current: number;
    pageSize: number;
    total?: number;
    selected:number;
    isSecond:number;
}


export function queryElectricalList(data:any) {
    console.log(data)
    console.log(data.selected)
    let params = {
        cat_id:null,
        cat_second_id:null
    };
    if (data.isSecond==0){
        params.cat_id = data.selected;
        delete params.cat_second_id
    }else {
        params.cat_second_id = data.selected;
        delete params.cat_id
    }
    return axios.get<any>('/admin/cat_circuit_version/list',{
        params
    });
}
export function deleteElectrical(data:any) {
    return axios.post<any>('/admin/cat_circuit_version/del',data);
}